package cn.rayland.app.yandktest;

/**
 * Created by Lei on 2/4/2016.
 */
public class Axis {
    public double max_feedrate;
    public double home_feedrate;
    public double steps_per_mm;
    public double length;
    public double max_acc;
    public double max_speed_change;
    public double cornerPos;
    public int endstop;
    public int endstopPol;
    public int dir;

    public Axis(){

    }
    public Axis(double thisMax_feedrate, double thisHome_feedrate, double thisSteps_per_mm, double thisLength, double thisMax_acc,
                double thisMax_speed_change, double thisCornerPos, int thisEndstop, int thisEndstopPol,int thisDir)
    {
        max_feedrate = thisMax_feedrate;
        home_feedrate = thisHome_feedrate;
        steps_per_mm = thisSteps_per_mm;
        length = thisLength;
        max_acc = thisMax_acc;
        max_speed_change = thisMax_speed_change;
        cornerPos = thisCornerPos;
        endstop = thisEndstop;
        endstopPol = thisEndstopPol;
        dir = thisDir;
    }

    @Override
    public String toString() {
        return "Axis{" +
                "max_feedrate=" + max_feedrate +
                ", home_feedrate=" + home_feedrate +
                ", steps_per_mm=" + steps_per_mm +
                ", length=" + length +
                ", max_acc=" + max_acc +
                ", max_speed_change=" + max_speed_change +
                ", cornerPos=" + cornerPos +
                ", endstop=" + endstop +
                ", endstopPol=" + endstopPol +
                ", dir=" + dir +
                '}';
    }
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Axis other = (Axis) obj;
		if (Double.doubleToLongBits(cornerPos) != Double
				.doubleToLongBits(other.cornerPos))
			return false;
		if (dir != other.dir)
			return false;
		if (endstop != other.endstop)
			return false;
		if (endstopPol != other.endstopPol)
			return false;
		if (Double.doubleToLongBits(home_feedrate) != Double
				.doubleToLongBits(other.home_feedrate))
			return false;
		if (Double.doubleToLongBits(length) != Double
				.doubleToLongBits(other.length))
			return false;
		if (Double.doubleToLongBits(max_acc) != Double
				.doubleToLongBits(other.max_acc))
			return false;
		if (Double.doubleToLongBits(max_feedrate) != Double
				.doubleToLongBits(other.max_feedrate))
			return false;
		if (Double.doubleToLongBits(max_speed_change) != Double
				.doubleToLongBits(other.max_speed_change))
			return false;
		if (Double.doubleToLongBits(steps_per_mm) != Double
				.doubleToLongBits(other.steps_per_mm))
			return false;
		return true;
	}
    
    
}
